import re

# 原始文本（此处省略具体内容，实际使用时替换为目标文本）
text = """Barack Obama is the 44th President of the USA. He was born in Hawaii in 1961 to a Kenyan father and American mother. His parents divorced and his mother married an Indonesian man, thus Obama lived in Indonesia between the ages of six to ten, before returning to Hawaii in 1972. He worked his way through college with the help of scholarships and student loans and went on to Harvard Law School.
	巴拉克·奥巴马是美国第44任总统。1961年，奥巴马出生于夏威夷州，父亲是一名肯尼亚人，母亲是美国人。之后父母离婚，母亲改嫁给了一名印度尼西亚人，在6-10岁时，奥巴马生活在印度尼西亚，1972年回到了夏威夷。通过奖学金和学生贷款，他完成了大学学业，之后进入了哈佛大学法学院。

	Barack’s story is the American story — values from the heartland, a middle-class upbringing in a strong family, hard work and education as the means of getting ahead, and the conviction that a life so blessed should be lived in service to others. At Harvard, he became the first African—American president of the Harvard Law Review. After graduating, he taught law at the University of Chicago.

	巴拉克的故事是典型的美国故事，美国价值观、在中产阶级中长大，教育以及自身的努力拼搏是其前进的途径，并深信人们应该服务于他人。他也是哈佛法学评论中唯一一位非洲裔美国籍总统。毕业之后，他在芝加哥大学教授法律。

	Obama served as State Senator for Illinois between 1997 and 2004. He was elected to the U.S. Senate in 2004,winning by a . This made him a rising star in the Democratic Party. He was a strong opponent ofthe Iraq War. His presidential campaign was the first to make full use of social media. His slogan “Yes,we can” helped him become America’s first African American president in 2009.

	1997-2004年，他是伊利诺伊州的参议院议员。2004年，奥巴马当选联邦参议员，并以压倒性的优势获胜。这使他成为了民主党的希望之星。他强烈反对伊拉克战争。他的总统竞选是首位全方面利用社会媒体的人。他的标语“我们能做到”帮助他获得了2009年的总统大选，并成为了美国历史上首位非洲裔美国总统。

	Obama’s term in office coincided with the global financial  of 2008. He inherited one of America’s worst ever economies. In 2009 he received the Nobel Peace Prize. He introduced major reforms to America’s healthcare system and sought a fairer  system. He began the troop  from Afghanistanand Iraq. He also  the mission that led to the death of Osama  . He was re-elected for asecond term in November, 2012.

	奥巴马的任期正好与2008年的全球金融萧条不期而遇。他接手了美国有史以来经济最糟糕的时期。2009年，他获得了诺贝尔和平奖。他对美国的医疗体系进行了大规模的改革，并建立了更加公平的税务体系。他还开始从阿富汗和伊拉克撤兵。并射杀了本拉登。2012年11月，他再次当选总统。"""

# 1. 按空行分割段落，过滤空字符串
paragraphs = [p.strip() for p in text.split('\n') if p.strip()]

print(paragraphs)

# # 2. 定义中文检测正则（匹配任意中文字符）
# chinese_pattern = re.compile(r'[\u4e00-\u9fff]')
#
# # 3. 统计英文和中文段落数量
# english_count = 0
# chinese_count = 0
#
# for para in paragraphs:
#     # 若段落中包含中文字符，则为中文段落
#     if chinese_pattern.search(para):
#         chinese_count += 1
#     else:
#         english_count += 1
#
# # 4. 输出结果
# print(f"英文段落数量：{english_count}")
# print(f"中文段落数量：{chinese_count}")